package love.yuanmeng.guetcoalsystem.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import love.yuanmeng.guetcoalsystem.vo.PropManagerVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
@Mapper
public interface PropManagerVoMapper extends BaseMapper<PropManagerVo> {

    @Select("SELECT ut.* " +
            "FROM " +
            "(" +
            "SELECT e.supplier_name,u.id as uid,u.username, o.*, p.* " +
            "FROM guetcoal.prop p left join guetcoal.order o on o.prop_id=p.id " +
            "left join guetcoal.enterprise_info e on o.enterprise_id2=e.enterprise_id " +
            "left join guetcoal.user u on u.enterpriseid=e.enterprise_id " +
            ") ut " +
            "WHERE ut.userid=${userid}")
    List<PropManagerVo> loadProp(@Param("userid") String userid);




}
